Refactor ConfigSource API for better encapsulation #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is largely a cleanup PR, removing unused or unnecessary code, refining interfaces, removing internal functions from public API, and making logging more verbose. no real functional changes. Net negative lines of code.
Summary
loadDwJson()to return{config, path}for proper path tracking in DwJsonSourcemapDwJsonToNormalizedConfig,mergeConfigsWithProtection,getPopulatedFieldsfrom public exports)sourcesoption fromResolveConfigOptionsResolvedB2CConfigdirectly with.values.*access patterncreateB2CInstance(),createMrtAuth(), etc.) instead of manual constructionreplaceDefaultSourcesoption to work without requiringsourcesAfterBug Fix: account-manager-host from dw.json ignored
Fixed an issue where
account-manager-hostconfigured in dw.json was being ignored. The oclif flag had adefaultvalue that was always passed as an override to config resolution, preventing dw.json values from being used. Removed the default from the flag definition and rely on the existing fallback in theaccountManagerHostgetter.Structured Logging Improvements
Improved structured logging across the SDK to ensure log calls have proper structured fields for machine-parseable output while preserving human-readable messages:
Pattern Applied
Files Updated
api-key.ts,basic.ts,oauth.ts,oauth-implicit.ts- Added auth-specific fields (headerName, keyPreview, username, port, duration)jobs/run.ts,jobs/site-archive.ts,code/deploy.ts,code/versions.ts,code/watch.ts- Added domain-specific fields (jobId, executionId, codeVersionId, cartridgeName, path)middleware.ts,webdav.ts- Added HTTP fields (method, url, status, duration)Key Changes
jobIdnotid,codeVersionIdnotversion)path,method,url,server)hostnametoserverin watch.tsBreaking Changes
loadConfig()now returnsResolvedB2CConfiginstead ofNormalizedConfig.values.*property (e.g.,this.resolvedConfig.values.hostname)ResolvedConfigtype alias removed from exportsTest plan